#!/bin/bash
runLog=/user5/z00622034/Program/ShellCode/run.log # log file
codePath=/user5/z00622034/Program/ohostest # the path to store the code

cmdList[0]="rm -rf $codePath"
cmdList[1]="mkdir -p $codePath/code"
cmdList[2]="cd $codePath/code"
cmdList[3]="/usr/local/bin/repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify"
# cmdList[3]="/usr/local/bin/repo init -u git@gitee.com:openharmony/manifest.git -b master --no-repo-verify"
cmdList[4]="/usr/local/bin/repo sync -c"
cmdList[5]="/usr/local/bin/repo forall -c 'git lfs pull'"
cmdList[6]="bash build/prebuilts_download.sh"
cmdList[7]="./build.sh --product-name ohos-sdk --target-cpu arm64"
# cmdList[7]="./build.sh --export-para PYCACHE_ENABLE:true --product-name ohos-sdk --ccache --target-cpu arm64 --gn-args enable_glfw_window=true"


echo "-------------------------start-------------------------" > $runLog
for (( i = 0; i < ${#cmdList[@]}; i++))
do
    echo -e "The command is \"${cmdList[$i]}\"." >> $runLog
    eval ${cmdList[$i]} >> $runLog
    echo -e "\n\n" >> $runLog
done
echo "--------------------------end--------------------------" >> $runLog
